﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Queue queue = new Queue();
            queue.Enqueue(0);
            queue.Enqueue("abc");
            queue.Enqueue(123);
            //遍历方式一
            //while (queue.Count != 0)
            //{
            //    Console.WriteLine(queue.Dequeue());//取出并删除
            // // Console.WriteLine(queue.Peek ());//取出不删除
            //}


            //遍历方式二 (arr中的不会被继承)
            int[] arr = {64,81,67};
            var arr1 = queue.ToArray();
            foreach (var item in arr1)
            {
                Console.WriteLine(item);
            }


            //遍历方式三

            var gentor = queue.GetEnumerator();
            while (gentor.MoveNext())
            {
                Console.WriteLine(gentor .Current );
            }



            //遍历方式四(foreach)


        }
    }


}
